index.md
Edit

yt-dlp를 사용하면 된다.

1. 설치

  • FFmpeg에서 바이너리를 다운받거나 homebrew를 설치한다. (오디오랑 비디오를 하나로 합칠때 쓰인다)
  • yt-dlp에서 바이너리를 다운받는다.

2. 다운로드

# mp4 형식으로 최대 길이 1080px 으로 영상 다운로드하기
yt-dlp -f "bv*[vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b" --live-from-start wydBufD_8qQ

# webm 형식으로 원본 영상 다운로드하기 (추후 mp4으로 변환해야하는 번거로움이 있음)
yt-dlp -f "bv+ba/b" --live-from-start wydBufD_8qQ

3. 테스트

공돌이파파 is going live!를 한번 다운해보자.

yt-dlp -f "bv*[vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b" --live-from-start m4SpqRWkvVg
~/Downloads  $ yt-dlp -f "bv*[vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b" --live-from-start m4SpqRWkvVg
[youtube] Extracting URL: m4SpqRWkvVg
[youtube] m4SpqRWkvVg: Downloading webpage
[youtube] m4SpqRWkvVg: Downloading ios player API JSON
[youtube] m4SpqRWkvVg: Downloading m3u8 information
[info] m4SpqRWkvVg: Downloading 1 format(s): 136+140
[download] Destination: 공돌이파파 is going live! [m4SpqRWkvVg].f140.m4a
[download] 100% of    2.45MiB in 00:00:00 at 25.37MiB/s
[Merger] Merging formats into "공돌이파파 is going live! [m4SpqRWkvVg].mp4"
Deleting original file 공돌이파파 is going live! [m4SpqRWkvVg].f140.m4a (pass -k to keep)
Deleting original file 공돌이파파 is going live! [m4SpqRWkvVg].f136.mp4 (pass -k to keep)
~/Downloads  $

【トゲナシトゲアリ】MyGO!!!!!×トゲナシトゲアリ 対バンライブ開催決定記者会見【Avoid Note】 같이 긴 영상도 다운해보자.

yt-dlp -f "bv*[vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b" --live-from-start lwxz_n5Z51I
[youtube] Extracting URL: lwxz_n5Z51I
[youtube] lwxz_n5Z51I: Downloading webpage
[youtube] lwxz_n5Z51I: Downloading ios player API JSON
[youtube] lwxz_n5Z51I: Downloading m3u8 information
[info] lwxz_n5Z51I: Downloading 1 format(s): 137+140
[download] Destination: 【トゲナシトゲアリ】MyGO!!!!!×トゲナシトゲアリ 対バンライブ開催決定記者会見【Avoid Note】 [lwxz_n5Z51I].f137.mp4
[download] 100% of  407.99MiB in 00:00:17 at 22.72MiB/s
[download] Destination: 【トゲナシトゲアリ】MyGO!!!!!×トゲナシトゲアリ 対バンライブ開催決定記者会見【Avoid Note】 [lwxz_n5Z51I].f140.m4a
[download] 100% of   44.22MiB in 00:00:01 at 32.54MiB/s
[Merger] Merging formats into "【トゲナシトゲアリ】MyGO!!!!!×トゲナシトゲアリ 対バンライブ開催決定記者会見【Avoid Note】 [lwxz_n5Z51I].mp4"
Deleting original file 【トゲナシトゲアリ】MyGO!!!!!×トゲナシトゲアリ 対バンライブ開催決定記者会見【Avoid Note】 [lwxz_n5Z51I].f140.m4a (pass -k to keep)
Deleting original file 【トゲナシトゲアリ】MyGO!!!!!×トゲナシトゲアリ 対バンライブ開催決定記者会見【Avoid Note】 [lwxz_n5Z51I].f137.mp4 (pass -k to keep)
~/Downloads  $

속도도 준수하고 아주 좋다.

rhea-so commented at 2024-07-21 12:46:29

라이브가 아닌 영상도 다운로드 할 수 있다.

rock to infinity를 다운해보자.

yt-dlp -f "bv*[vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b" JlMZXRlhHfA
[youtube] Extracting URL: JlMZXRlhHfA
[youtube] JlMZXRlhHfA: Downloading webpage
[youtube] JlMZXRlhHfA: Downloading ios player API JSON
[youtube] JlMZXRlhHfA: Downloading m3u8 information
[info] JlMZXRlhHfA: Downloading 1 format(s): 135+140
[download] Destination: rock to infinity [JlMZXRlhHfA].f135.mp4
[download] 100% of   15.70MiB in 00:00:00 at 29.66MiB/s
[download] Destination: rock to infinity [JlMZXRlhHfA].f140.m4a
[download] 100% of    2.60MiB in 00:00:00 at 28.69MiB/s
[Merger] Merging formats into "rock to infinity [JlMZXRlhHfA].mp4"
Deleting original file rock to infinity [JlMZXRlhHfA].f135.mp4 (pass -k to keep)
Deleting original file rock to infinity [JlMZXRlhHfA].f140.m4a (pass -k to keep)
~/Downloads  $

--live-from-start 를 뺀 상태로 명령어를 호출하면 된다.

rhea-so commented at 2024-08-20 16:11:15
yt-dlp -f "bv*[vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b" --download-sections "*00:32:53.2-00:32:55.5" e4Kw9ADHJZ8

이렇게 하면 특정 시간만 받을 수 있다!!

rhea-so commented at 2024-08-20 16:13:20
yt-dlp -f "bv*[vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b" --download-sections "*07:29:35-07:32:40" e4Kw9ADHJZ8

아주 잘된다

Open in GitHub Gist
Back to Home